//
//  BDShopManagerModel.m
//  BadBoy
//
//  Created by wen on 2017/9/8.
//  Copyright © 2017年 com.8xiong. All rights reserved.
//

#import "BDShopManagerModel.h"

@implementation BDShopManagerModel

+ (NSDictionary *)modelCustomPropertyMapper {
    return @{@"managerID":@"id"};
}

- (BOOL)modelCustomTransformFromDictionary:(NSDictionary *)dic {
    if (dic[@"user"]) {
        NSDictionary *userDic = dic[@"user"];
        if (![userDic isKindOfClass:[NSNull class]]) {
            self.user_id = [userDic[@"user_id"] integerValue];
            self.nickname = userDic[@"nickname"];
            self.cover = userDic[@"cover"];
            self.mobile = userDic[@"mobile"];
        }else{
            self.user_id = 0;
            self.nickname = ASLocalizedString(@"该用户不存在");
            self.cover = @"";
            self.mobile = nil;
        }
        
    }
    else {
        self.user_id = [dic[@"user_id"] integerValue];
        self.nickname = dic[@"nickname"];
        self.cover = dic[@"cover"];
        self.mobile = dic[@"mobile"];
    }
    return YES;
}

@end
